package com.example.haojiutao.mapper;

import com.example.haojiutao.model.domain.GoodsType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Description: 商品种类持久层接口
 * @Author: ma_lihong
 * @CreateTime: 2024/1/18 16:53
 */
@Mapper
public interface GoodsTypeMapper {
    /*
     * @Description: 新增商品种类
     * @Author: ma_lihong
     * @CreateTime: 2024/1/18 14:54
     * @param: gt
     * @return: int
     */
    Integer insertType(GoodsType gt);

    /*
     * @Description:删除
     * @Author: ma_lihong
     * @CreateTime: 2024/1/18 16:29
     * @param: gt
     * @return: int
     */
    Integer deleteType(GoodsType gt);

    /*
     * @Description: 列表查询
     * @Author: ma_lihong
     * @CreateTime: 2024/1/20 11:06
     * @param: gt
     * @return: com.example.haojiutao.common.Result
     */
    List<GoodsType> selectByList(GoodsType gt);

    /*
     * @Description:根据id查询
     * @Author: ma_lihong
     * @CreateTime: 2024/1/19 15:12
     * @param: goodsType
     * @return: com.example.haojiutao.common.Result
     */
    GoodsType selectById(int typeId);

    List<GoodsType> selectListByUser(GoodsType gt);

    /*
     * @Description: 查询父类型
     * @Author: ma_lihong
     * @CreateTime: 2024/1/20 11:06
     * @param: parentId
     * @return: com.example.haojiutao.model.domain.GoodsType
     */
    GoodsType selectByParentId(int parentId);

    Integer selectCountByParentId(Integer parentId);

    List<GoodsType> selectlListByParent(GoodsType gt);
}
